@echo off

if "%BUILDDIR%" =="" (
    
    echo ERROR: i can not install the library
    echo        first it is necessary to build
    exit/b
)

set DESTINATION_DIRECTORY=%~1
set DST_NAME=%DESTINATION_DIRECTORY%\%NAME_PRODUCT%
set DST_INCLUDE=%DST_NAME%\include
set DST_LIB=%DST_NAME%\lib

set HEADER=%SOURCE_DIRECTORY%include
set LIBRARY=%SOURCE_DIRECTORY%%BUILDDIR%\%MODE%

if not exist %DST_LIB%  mkdir %DST_LIB%
if not exist %DST_NAME% mkdir %DST_NAME% 

set need_copy_headers=
if not exist %DST_INCLUDE% (
    mkdir %DST_INCLUDE%
    set need_copy_headers=true
)

xcopy %LIBRARY%  /y /e %DST_LIB%\
if  "%need_copy_headers%"=="true" xcopy %HEADER%  /y /e %DST_INCLUDE%\

exit /b


